﻿namespace Grow.Module.Options
{
    /// <summary>
    /// 选项管理器
    /// </summary>
    public interface IOptionsManager
    {
        /// <summary>
        /// 添加选项
        /// </summary>
        /// <typeparam name="TOptions">选项类型</typeparam>
        /// <param name="optionsAction">选项委托</param>
        void AddOptions<TOptions>(Action<TOptions> optionsAction) where TOptions : class, IOptions;

        /// <summary>
        /// 添加选项
        /// </summary>
        /// <typeparam name="TOptions">选项类型</typeparam>
        /// <param name="name">选项键值</param>
        /// <param name="optionsAction">选项委托</param>
        void AddOptions<TOptions>(string name, Action<TOptions> optionsAction) where TOptions : class, IOptions;

        /// <summary>
        /// 获取选项绑定对象
        /// </summary>
        /// <returns></returns>
        IOptionsBind GetOptionsBind();
    }
}
